<html><body>
<?php

// Connecting, selecting database
$link = mysql_connect('YOUR_TEAM_LAMP_ADDRESS', 'YOUR_TEAM_MYSQL_ACCOUNT', 'YOUR_TEAM_MYSQL_PASSWORD') or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';

mysql_select_db('YOUR_DB_NAME') or die('Could not select database');

// Performing SQL query
$query = 'SELECT * FROM mydata';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());

// Printing results in HTML
echo "<table border=1>\n";
echo "<tr><td>MAC</td><td>Timestamp</td><td>Light</td></tr>";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
    echo "\t<tr>\n";
    foreach ($line as $col_value) {
        echo "\t\t<td>$col_value</td>\n";
    }
    echo "\t</tr>\n";
}
echo "</table>\n";

// Free resultset
mysql_free_result($result);

// Closing connection
mysql_close($link);


?>
</body></html>